/*package com.zhiduan.crowdclient.swipeview;

import com.zhiduan.crowdclient.R;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Scroller;
import android.widget.TextView;


public class SlideView extends LinearLayout {

    private static final String TAG = "SlideView";

    private Context mContext;
    // 用来放置所有view的容器  
    private LinearLayout mViewContent;
    private RelativeLayout mHolder;
    private Scroller mScroller;
    private OnSlideListener mOnSlideListener;
    private int mHolderWidth = 80;
    
 // 分别记录上次滑动的坐标  
    private int mLastX = 0;
    private int mLastY = 0;
    private int count = 0;
    private boolean isMove = true;
    // 用来控制滑动角度，仅当角度a满足如下条件才进行滑动：tan a = deltaX / deltaY > 2  
    private static final int TAN = 2;
    *//********** edhlily 改动的第二个部分 *******************************************//*
    private int downX = 0;
    private int downY = 0;

    public boolean isClick() {
    	return Math.abs(mLastX - downX) < 5;
    }

    // 判断条目是否是真的点击了,如果左右滑动了就不算点击,解决滑动过程中被点击的问题
    public interface OnSlideListener {
    	// SlideView的三种状态：开始滑动，打开，关闭  
        public static final int SLIDE_STATUS_OFF = 0;
        public static final int SLIDE_STATUS_START_SCROLL = 1;
        public static final int SLIDE_STATUS_ON = 2;

        *//**
         * @param view current SlideView
         * @param status SLIDE_STATUS_ON or SLIDE_STATUS_OFF
         *//*
        public void onSlide(View view, int status);
    }

    public SlideView(Context context) {
        super(context);
        initView();
    }

    public SlideView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    private void initView() {
        mContext = getContext();
        mScroller = new Scroller(mContext);

        setOrientation(LinearLayout.HORIZONTAL);
        View.inflate(mContext, R.layout.activity_listview_delete_slide_view_merge, this);
        mViewContent = (LinearLayout) findViewById(R.id.view_content);
        mHolderWidth = Math.round(TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP, mHolderWidth, getResources()
                        .getDisplayMetrics()));
    }

    public void setButtonText(CharSequence text) {
        ((TextView)findViewById(R.id.delete)).setText(text);
        ((TextView)findViewById(R.id.edit)).setText(text);
    }

    public void setContentView(View view) {
        mViewContent.addView(view);
    }

    public void setOnSlideListener(OnSlideListener onSlideListener) {
        mOnSlideListener = onSlideListener;
    }
    // 将当前状态置为关闭  
    public void shrink() {
        if (getScrollX() != 0) {
            this.smoothScrollTo(0, 0);
        }
    }

    // 根据MotionEvent来进行滑动，这个方法的作用相当于onTouchEvent  
    // 如果你不需要处理滑动冲突，可以直接重命名，照样能正常工作  
    public void onRequireTouchEvent(MotionEvent event) {
        int x = (int) event.getX();
        int y = (int) event.getY();
        int scrollX = getScrollX();
        Log.d(TAG, "x=" + x + "  y=" + y);

        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN: {
        	
        	mLastX=x;
        	mLastY=y;
        	*//****************** edhlily改动的第一个部分 **********************//*
    		downX = x;
    		downY = y;
    		*//****************** edhlily改动的第一个部分 **********************//*
    		isMove = true;
    		count = 0;
            if (!mScroller.isFinished()) {
                mScroller.abortAnimation();
            }
            if (mOnSlideListener != null) {
                mOnSlideListener.onSlide(this,
                        OnSlideListener.SLIDE_STATUS_START_SCROLL);
            }
            break;
        }
        case MotionEvent.ACTION_MOVE: {
        	*//****************** edhlily改动的第二个部分 **********************//*
    		int deltaX = x - downX;
    		int deltaY = y - downY;
    		*//****************** edhlily改动的第二个部分 **********************//*
    		// int deltaX = x - mLastX;
    		// int deltaY = y - mLastY;
//            if (Math.abs(deltaX) < Math.abs(deltaY) * TAN) {
//                break;
//            }
    		if (count <= 5) {
    			count++;
    			if (Math.abs(deltaX) < Math.abs(deltaY)) {
    				isMove = false;
    				Log.e("触摸：", "不是移动" + x + "-" + y + "-" + deltaX + "-" + deltaY);
    				break;
    			} else {
    				isMove = true;
    				Log.e("触摸：", "是移动" + x + "-" + y + "-" + deltaX + "-" + deltaY);
    			}
    		} else {
    			if (!isMove) {
    				break;
    			}
    		}
    		mLastX = x;
    		mLastY = y;
            int newScrollX = scrollX - deltaX;
            if (deltaX != 0) {
                if (newScrollX < 0) {
                    newScrollX = 0;
                } else if (newScrollX > mHolderWidth) {
                    newScrollX = mHolderWidth;
                }
                this.scrollTo(newScrollX, 0);
            }
            break;
        }
        case MotionEvent.ACTION_UP: {
            int newScrollX = 0;
            if (scrollX - mHolderWidth * 0.75 > 0) {
                newScrollX = mHolderWidth;
            }
            this.smoothScrollTo(newScrollX, 0);
            if (mOnSlideListener != null) {
                mOnSlideListener.onSlide(this,
                        newScrollX == 0 ? OnSlideListener.SLIDE_STATUS_OFF
                                : OnSlideListener.SLIDE_STATUS_ON);
            }
            break;
        }
        default:
            break;
        }

        mLastX = x;
        mLastY = y;
    }

    private void smoothScrollTo(int destX, int destY) {
        // 缓慢滚动到指定位置        
    	int scrollX = getScrollX();
        int delta = destX - scrollX;
        mScroller.startScroll(scrollX, 0, delta, 0, Math.abs(delta) * 3);
        invalidate();
    }

    @Override
    public void computeScroll() {
        if (mScroller.computeScrollOffset()) {
            scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
            postInvalidate();
        }
    }

}
*/